class college { name: string; staff_count: number; stud_count: number; constructor(n1: string, staf: number, stud: number) { this.name = n1; this.staff_count = staf; this.stud_count = stud; } display() { console.log(this.name); } } class comp_sci extends college{ constructor(n1: string, staf: number, stud: number) { super(n1, staf, stud); } display() { console.log("Details of Computer science department"); console.log("Hod name:" + this.name); console.log("Total number of staff:" + this.staff_count); console.log("Total number of student:" + this.stud_count); } } class civil extends college{ constructor(n1: string, staf: number, stud: number) { super(n1, staf, stud); } display() { console.log("Details of Civil Engineering department"); console.log("Hod name:" + this.name); console.log("Total number of staff:" + this.staff_count); console.log("Total number of student:" + this.stud_count); } } class ece extends college{ constructor(n1: string, staf: number, stud: number) { super(n1, staf, stud); } display() { console.log("Details of Electronics and communication department"); console.log("Hod name:" + this.name); console.log("Total number of staff:" + this.staff_count); console.log("Total number of student:" + this.stud_count); } } class it extends college{ constructor(n1: string, staf: number, stud: number) { super(n1, staf, stud); } display() { console.log("Details of Information Technology department"); console.log("Hod name:" + this.name); console.log("Total number of staff:" + this.staff_count); console.log("Total number of student:" + this.stud_count); } } var c = new college("Anna University",0,0); c.display(); var cs = new comp_sci("Kannan", 15, 400); var IT = new it("Sridhar", 12, 380); var civ = new civil("Manivannan", 17, 450); var Ece = new ece("Prince", 12, 400); console.log("List of Departments available in the college"); console.log("1.Computer science\n" + "2.Civil Engineering\n" + "3.Electronics and communication\n" + "4.Information Technology\n"); console.log("Enter the option from the list to see the details"); var choice: number = parseInt(prompt()); switch (choice) { case 1: cs.display(); break; case 2: civ.display(); break; case 3: Ece.display(); break; case 4: IT.display(); break; default: console.log("Invalid option"); break; }